<template>
   <div id="detailList">
      <div class="contBtn">
         <v-btn :btnConfig="btnConfig" @exportFile="exportFile" @back="back"></v-btn>
      </div>
      <div class="contTable">
         <v-table
             :hasEdit="false"
             :checked="false"
             :pageSize="pageSize"
             :page="page"
             :tableConfig="tableConfig"
             :tableData="tableData"
             :total="total"
             @findData="getTableData"
             @getTableData="getTableData"
             @searhData="searhData"
             @selectData="selectData"
             @upData="getTableData"
             ref="table"
         ></v-table>
      </div>
   </div>
</template>

<script>
import table from "commons/Table";
import btn from "@/components/commons/TableTitle";

export default {
   name: "detailList",
   data() {
      return {
         btnConfig: [
            {label: this.$t('common.export'), invalid: "exportFile"},
            {label: this.$t('common.return'), invalid: "back"},
         ],

         tableConfig: [
            {
               label: this.$t('out.eventid'),
               prop: "id",
               input: "input",
            },
            {
               label: this.$t('out.eventtype'),
               prop: "type",
               input: "input",
            },
            {
               label: this.$t('config.shipper'),
               prop: "storerkey",
               input: "input",
            },
            {
               label: this.$t('config.sku'),
               prop: "sku",
               input: "input",
            },
            {
               label: this.$t('in.lot'),
               prop: "lot",
               input: "input",
            },
            {
               label: this.$t('outbound.fromloc'),
               prop: "loc",
               input: "input",
            },
            {
               label: this.$t('out.cartonizationkey'),
               prop: "cartonizationkey",
               input: "input",
            },
            {
               label: this.$t('config.toLoc'),
               prop: "toloc",
               input: "input",
            },
            {
               label: this.$t('out.tocartonizationkey'),
               prop: "tocartonizationkey",
               input: "input",
            },
            {
               label: this.$t('out.orderno'),
               prop: "order",
               input: "input",
            },
            {
               label: this.$t('common.status'),
               prop: "status",
               input: "input",
            },
            {
               label: this.$t('config.num'),
               prop: "num",
               input: "input",
            },
            {
               label: this.$t('config.packaging'),
               prop: "packkey",
               input: "input",
            },
            {
               label: this.$t('outbound.uom'),
               prop: "unit",
               input: "input",
            },
            {
               label: this.$t('in.receiptkey'),
               prop: "sorder",
               input: "input",
            },
            {
               label: this.$t('out.horder'),
               prop: "horder",
               input: "input",
            },
            {
               label: this.$t('common.time'),
               prop: "time",
               input: "date",
            },
            {
               label: this.$t('app.editName'),
               prop: "user",
               input: "input",
            },
         ],
         tableData: [
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
            {
               id: "0000000000",
               type: "AJ",
               storerkey: "ceshi",
               sku: "ceshi",
               lot: "L000061120",
               loc: "STAGE",
               cartonizationkey: "LPN202010271438",
               toloc: "STAGE",
               tocartonizationkey: "LPN202010271438",
               order: "000002914200001",
               status: "OK",
               num: "-20",
               packkey: "STD",
               unit: "EA",
               sorder: "0000029142",
               horder: "00001",
               time: "2020-11-19 16:43:50",
               user: "panda"
            },
         ],
         pageSize: 10,
         page: 1,
         total: 10,
      }
   },
   methods: {
      back() {
         this.$router.go(-1);
      },
      exportFile() {
        //  this.$message.success("导出")
      },
      selectData(data) {
         this.tableSelectData = data;
      },
      async getTableData(page, data) {
         /* try {
             this.loading = true;
             let res = await this.$api.post(`/queryAltskuList/${page}`, data);
             
                this.tableData = res.page.list;
                this.page = res.page.curpage;
                this.pageSize = res.page.pageSize;
                this.total = res.page.total;
             } else {
                this.$message.error(res.returnMgr);
             }
          } catch (e) {
             this.$message.error(error);
          } finally {
             this.loading = false;
          }*/
      },
      //搜索的值
      searhData(data, up) {
         if (!up) {
            this.tableSearhData = data;
         } else {
            this.tableSearhData = data;
            this.getTableData(1, this.tableSearhData);
         }
      },
   },
   mounted() {
   },
   components: {
      "v-table": table,
      "v-btn": btn
   }
}
</script>

<style scoped>
#detailList {
   width: 100%;
   height: 100%;
}

.contTable {
   height: calc(100% - 50px);
}
</style>
